/*
 * @Author: 王明明834578987 10266004+wang-mingming-834578987@user.noreply.gitee.com
 * @Date: 2024-08-29 10:59:21
 * @LastEditors: 王明明834578987 10266004+wang-mingming-834578987@user.noreply.gitee.com
 * @LastEditTime: 2024-10-14 17:46:22
 * @FilePath: \ft-apply-admin\src\api\application-details\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */


import { get, post } from "./http";
import type { requestType } from "@/views/ApplicationDetails/application-type"
export function selectCommonConfigDetail(param) {
  return get("/config/selectCommonConfigDetail", param)
}
export const selectResumesById = (params: requestType) => {  //根据简历id 获取简历详情
  return get("/applicationUser/selectResumesById", params,)
}
export const updateRecommendsResumes = (params: requestType) => {  //编辑简历内推人
  return post("/applicationUser/updateRecommendsResumes", params,)
}
export const updateSystemUserResumes = (params: requestType) => {  //后台系统编辑简历
  return post("/applicationUser/updateSystemUserResumes", params,)
}

export const saveSystemUserResumes = (params: requestType) => {  //后台系统用户新增简历
  return post("/applicationUser/saveSystemUserResumes", params,)
}

export const resumeProgress = (params: requestType) => {  //简历环节 （通过P 淘汰F）
  return post("/applicationProcess/resumeProgress", params,)
}

export const touchless = (params: requestType) => {  //记录未联系上详情
  return post("/applicationProcess/touchless", params,)
}
export const touchlessList = (params: { resumeId: string | number }) => {  //更换面试类型 线上
  return get("/applicationProcess/touchlessList", params,)
}

export const onlineInterviewType = (params: { resumeId: string | number }) => {  //更换面试类型 线上
  return get("/applicationProcess/onlineInterviewType", params,)
}

export const offlineInterviewType = (params: { resumeId: string | number }) => {  //更换面试类型 线下
  return get("/applicationProcess/offlineInterviewType", params,)
}

export const interviewSchedule = (params: requestType) => {  //预约面试 （预约面试 线上/线下 放弃Q）
  return post("/applicationProcess/interviewSchedule", params,)
}

export const interview = (params: requestType) => {  //待面试 （到面P 放弃Q 改期））
  return post("/applicationProcess/interview", params,)
}

export const arriveSchedule = (params: requestType) => {  //到面 （通过 淘汰 放弃）
  return post("/applicationProcess/arriveSchedule", params,)
}


export const trainingSchedule = (params: requestType) => {  //待约培 （预约培训 未联系上 放弃）
  return post("/applicationProcess/trainingSchedule", params,)
}

export const trainingEmailSent = (params: requestType) => {  //待培 （发送培训邮件）
  return post("/applicationProcess/trainingEmailSent", params,)
}

export const trainingArrive = (params: requestType) => {  //到培 （确认到培P 改期 放弃Q）
  return post("/applicationProcess/trainingArrive", params,)
}

export const trainingProgress = (params: requestType) => {  //培训中 （培训评价 淘汰 放弃）
  return post("/applicationProcess/trainingProgress", params,)
}

export const assessmentProgress = (params: requestType) => {  //考核中 （改期 通过 淘汰 放弃）
  return post("/applicationProcess/assessmentProgress", params,)
}

export const addInterviewAssess = (params: requestType) => {  //新增面试评价
  return post("/applicationProcess/addInterviewAssess", params,)
}

export const addExamineAssess = (params: requestType) => {  //新增考核评价
  return post("/applicationProcess/addExamineAssess", params,)
}

export const offerIssued = (params: requestType) => {  //待录取 （发放offer 淘汰）
  return post("/applicationProcess/offerIssued", params,)
}

export const agreementSigned = (params: requestType) => {
  return post("/applicationProcess/agreementSigned", params,)
}

export const contractSigned = (params: requestType) => {
  return post("/applicationProcess/contractSigned", params,)
}

export const secondInterview = (params: requestType) => {
  return post("/applicationProcess/secondInterview", params)
}
export const onBoardingProgress = (params: requestType) => {
  return post("/applicationProcess/onBoardingProgress", params,)
}

export const internshipProgress = (params: requestType) => {
  return post("/applicationProcess/internshipProgress", params,)
}
export const probationProgress = (params: requestType) => {
  return post("/applicationProcess/probationProgress", params,)
}
export const getProcessListByCode = (params: requestType) => {
  return get("/applicationDeal/getProcessListByCode", params,)
}
export const progressRollback = (params: requestType) => {
  return post("/applicationDeal/progressRollback", params,)
}
export const confirmed = (params: requestType) => {
  return post("/applicationProcess/confirmed", params,)
}

export const selectUserByRole = (type, index = 1) => {
  const param =
    { type: index, request: type }
  return get("/auth/selectUserByRole", param)
}

export const selectTrainingNumberList = () => {  //获取培训期数
  return get('/applicationUser/selectTrainingNumberList', {})
}


export const progressIndex = (param) => {  //获取培训期数
  return get('/applicationDeal/progressIndex', param)
}

export const getResumeRecordList = (param) => {  //
  return get('/resume/service/list', param)
}
export const uploadContractFile = (param) => {  //上传三方协议url
  return post('/applicationProcess/uploadContractFile', param)
}

export const addRecord = (param) => {  //新增简历维护记录
  return post('/resume/service/add', param)
}
export const getRecord = (param) => {  //查询维护记录
  return get('/resume/service/list', param)
}

export const selectResumesLogList = (param) => {  //获取简历修改记录
  return get('/config/selectResumesLogList', param)
}
export const assessIndex = (param) => {  //左侧评价流程渲染（面试环节。。。）
  return get('/applicationDeal/assessIndex', param)
}
export const selectCommonConfigFoChildren = (param: { type: number; parentId: number }) => {
  return get('/config/selectCommonConfigFoChildren', param)
}
export const getEntrySchoolInfo = (param: { type: number; parentId: number }) => {
  return get('/applicationDeal/getEntrySchoolInfo', param)
}

export const sendTrainingEmail = (param: { type: number; parentId: number }) => {
  return post('/training/sendTrainingEmail', param)
}

export const searchResumesByName = (param: { searchName: string }) => {
  return get('/applicationUser/searchResumesByName', param)
}
export const preserveUser = (param: { searchName: string }) => {  //批量修改维护HR
  return post('/tabulation/batchUpdate/preserveUser', param)
}
export const interviewUser = (param: { searchName: string }) => {  //批量修改约面HR
  return post('/tabulation/batchUpdate/interviewUser', param)
}

export const interviewer = (param: { searchName: string }) => {  //批量修改面试HR
  return post('/tabulation/batchUpdate/interviewer', param)
}
export const selectTrainingNumberFoTime = (param) => {
  return get('/training/selectTrainingNumberFoTime', param)
}

export const changeSchoolInfo = (param: any) => {
  return post('/applicationDeal/changeSchoolInfo', param)
}

export const selectUniversityDetail = (param: any) => {  //获取高校名单
  return get('/config/selectUniversityDetail', param)
}
export const saveUserResumes = (param: any) => {  //移动端用户提交简历
  return post('applicationUser/saveSystemUserResumes', param)
}
export const uploadAttachment = (param: any) => {    //上传用户简历附件 重新提交只更新
  return post('applicationUser/uploadAttachment', param)
}

export const uploadUserImage = (param: any) => {   //上传用户个人图片 重新提交只更新
  return post('applicationUser/uploadUserImage', param)
}
export const userIndexStatus = (param: any) => {  //用户首页 展示状态
  return post('applicationUser/userIndexStatus', param)
}
export const updateOnDutyTime = (param: any) => {  //用户首页 展示状态
  return post('applicationProcess/updateOnDutyTime', param)
}

export const selectStatusByTrainId = (param: any) => {
  return get('/training/selectStatusByTrainId', param)
}

// 导出培训详情列表
export function exportTrainingNumberDetail(param) {
  return post('/training/export/selectTrainingNumberDetailPage', param, { responseType: 'blob' })
}

// 导出培训详情(word文件zip)
export function exportTrainingUserDetail(param) {
  return post('/training/exportTrainingUserDetail', param, { responseType: 'blob' })
}
// 修改简历标签
export function updateLabel(param) {
  return get('/applicationUser/updateLabel', param)
}
export function uploadUpdateResumesAttachment(param) {
  return post('/applicationUser/uploadUpdateResumesAttachment', param)
}
// 判断是否存在考核评价
export function checkIsExistExamineAssess(param) {
  return post('/applicationProcess/checkIsExistExamineAssess', param)
}